<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<f:view>
	<h:head>
		<link type="text/css" rel="stylesheet" href="themes/bluesky/skin.css" />
		<link type="text/css" rel="stylesheet"
			href="resources/css/wienerhelden.css" />
	</h:head>
	<h:body>

		<ui:composition template="template.xhtml">
			<ui:define name="content">
				<f:view>





					<h:form id="form1">

			<!--  	<br></br>
						<p:commandButton id="createProcess"
							value="Start new Process (For Testing)" update=":form1"
							action="#{poolController.startProcess()}"
							icon="ui-icon-circle-triangle-e" title="Start Process" />
						<br></br> -->		

						<h3>Task assigned to your group</h3>

						<p:dataTable id="list1" var="task"
							value="#{poolController.groupWorkerTasks()}">

							<f:facet name="header">  
						            Click to select Task and assign it to you
						        </f:facet>

							<p:column headerText="Process Id">
								<h:outputText value="#{task.executionId}" />
							</p:column>

							<p:column headerText="Task ID">
								<h:outputText value="#{task.id}" />
							</p:column>

							<p:column sortBy="#{task.name}" headerText="Name">
								<h:outputText value="#{task.name}" />
							</p:column>

							<!-- 
						        <p:column headerText="Owner">  
						            <h:outputText value="#{task.owner}" />  
						        </p:column> 
						        -->

							<p:column headerText="Assignee">
								<h:outputText value="#{task.assignee}" />
							</p:column>

							<p:column sortBy="#{task.createTime}" headerText="Date Created">
								<h:outputText value="#{task.createTime}" />
							</p:column>

							<!-- 
						        <p:column headerText="Info">  
						            <h:outputText value="#{poolController.getProcessInfo(task)}" />  
						        </p:column>
						        -->
							<p:column headerText="Description">
								<h:outputText value="#{task.description}" />
							</p:column>

							<p:column id="col1" style="width:4%">
								<p:commandButton id="buttonAssign" value="Assign"
									update=":form1"
									action="#{poolController.assignTaskToUserAction(task)}"
									icon="ui-icon-person" title="Assign to Me" />
							</p:column>

							<p:column id="col2" style="width:4%">
								<p:commandButton id="buttonKill" value="Kill Process"
									update=":form1" action="#{poolController.abortProcess(task)}"
									icon="ui-icon-trash" title="Kill Process" />
							</p:column>
						</p:dataTable>

					</h:form>

				</f:view>
			</ui:define>
		</ui:composition>
	</h:body>
</f:view>
</html>
